package com.hzit.boot.controller;

import com.hzit.boot.entity.R;
import com.hzit.boot.entity.Student;
import com.hzit.boot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@RestController
@RequestMapping("/student")
public class StudentController2 {
	@Autowired
	private StudentService studentService;

	//1. 查询所有学生
	@GetMapping("/list2")
	public R findAll(){
		List<Student> studentList = studentService.findAll2();
		return R.ok().data("list",studentList);
	}

}
